package com.kaikeba.t31.service.impl;

import com.kaikeba.t31.admin.po.AdminRoleUser;
import com.kaikeba.t31.core.service.impl.CrudServiceImpl;
import com.kaikeba.t31.dao.AdminRoleUserMapper;
import com.kaikeba.t31.service.AdminRoleUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yumingzhi
 * @since 2021-11-15
 */
@Service
public class AdminRoleUserServiceImpl extends CrudServiceImpl<AdminRoleUser> implements AdminRoleUserService {

    @Resource
    private AdminRoleUserMapper adminRoleUserMapper;

    @Override
    public void deleteByRole(Long roleId) {
        adminRoleUserMapper.deleteByRole(roleId);

    }

    @Override
    public boolean saveBatch(List<AdminRoleUser> entityList) {
        return adminRoleUserMapper.saveBatch(entityList);
    }

    @Override
    public List<AdminRoleUser> getRoleByUserId(Long userId) {
        return adminRoleUserMapper.getRoleByUserId(userId);
    }
}
